Release 10.1A: OpenEdge Getting Started:
Object-oriented Programming
Comparing class files and procedure files
A class file has many similarities to a procedure file but there are some differences. Both class files and procedure files define a main block in which state and behavior are defined. Unlike procedure files, which are more free form, the main block of a class file must be defined between a starting
CLASSstatement and a terminatingENDCLASSstatement. TheCLASSstatement is necessary to specify the class type and other information required to support the class definition, such as any inheritance or interface specifications.As with procedure files that allow data elements scoped to the procedure file to be defined outside of any internal procedure or user-defined function definitions, data members scoped to a class are specified with
DEFINEstatements in its main block, outside of any method definitions. Unlike procedure files, no executable code can appear in the main block that is outside of method definitions andONstatements. In addition, a class file cannot define parameters for its main block. Classes support an optional constructor to take any parameters and execute any code when the class is instantiated.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |